from streamlit_option_menu import option_menu

from business.algorithm.utils import *
from business.page import Home, BasicData, FeatureEngineering, Regression, Classification, \
    ClusterReduceDim, ActiveLearning, TransferLearning, ModelInference, InterpretableMachineLearning


st.set_page_config(
    page_title="材料检测",
    page_icon="🍁",
    layout="centered",
    initial_sidebar_state="auto",
    menu_items={
    })

sysmenu = '''
<style>
MainMenu {visibility:hidden;}
footer {visibility:hidden;}
'''

# https://icons.bootcss.com/
st.markdown(sysmenu, unsafe_allow_html=True)

import matplotlib.pyplot as plt

plt.rcParams["font.sans-serif"] = ["SimHei"] # 设置字体为黑体
plt.rcParams["axes.unicode_minus"] = False # 正常显示负号

with st.sidebar:
    #
    # st.write('''
    #  # 人工智能材料实验平台
    #      ''')
    select_option = option_menu("材料实验智能平台", ["主页", "基础数据", "特征工程", "机器学习：聚类与降维",
                                             "机器学习：回归", "机器学习：分类", "机器学习：迁移学习",
                                             "机器学习：模型推理", "机器学习：代理优化", "机器学习：主动学习",
                                             "可解释机器学习"],
                                icons=['house', 'clipboard-data', 'menu-button-wide', 'circle', 'bezier2', 'subtract',
                                       'arrow-repeat', 'app', 'microsoft', 'search', 'book-half'],
                                menu_icon="boxes", default_index=0)
    # st.write('''
    #        **产品**:
    #        ''')

if select_option == "主页":
    Home.run()
elif select_option == "基础数据":
    BasicData.run()
elif select_option == "特征工程":
    FeatureEngineering.run()
elif select_option == "机器学习：回归":
    Regression.run()
elif select_option == "机器学习：分类":
    Classification.run()
elif select_option == "机器学习：聚类与降维":
    ClusterReduceDim.run()
elif select_option == "机器学习：主动学习":
    ActiveLearning.run()
elif select_option == "机器学习：迁移学习":
    TransferLearning.run()
elif select_option == "机器学习：代理优化":
    from business.page import SurrogateOptimization, Home

    SurrogateOptimization.run()
elif select_option == "机器学习：模型推理":
    ModelInference.run()
elif select_option == "可解释机器学习":
    InterpretableMachineLearning.run()

